// @ts-nocheck
import React from "react";
import { Menu } from 'antd';
import styles from './index.module.less'

export default ({ theme, mode = "horizontal", menu, handleMenuClick, ...attrs }) => (
  <div className={styles['top-nav']}>
  <Menu
    theme={theme}
    mode={mode}
    selectedKeys={[menu?.active]}
    {...attrs}
  >
    {menu?.children.map(({ id, title, icon }) => (
      <Menu.Item icon={icon} key={id}><span onClick={() => handleMenuClick(menu.id, id)}>{title}</span></Menu.Item>
    ))}
  </Menu>
  </div>
)
